import Vue from 'vue'
import App from './App.vue'

import http from '@/common/plugins/axios/http'
import api from '@/common/plugins/axios/api'
import filters from '@/common/filters'
import directives from '@/common/directives'
import Components from '@/common/components'

import router from './router'
import utils from '@/common/utils'
import store from './store'

import ELEMENT from 'element-ui'
import VueProgressBar from 'vue-progressbar'

import './assets/scss/index.scss'
import { SERVICE_NAME } from '@/cadmin/plugins/constant'

Vue.use(http)
Vue.use(api)
Vue.use(directives)
Vue.use(utils)
Vue.use(Components)
Vue.use(ELEMENT, { size: 'medium' })
Vue.use(VueProgressBar, { color: '#fa9600' })

// 全局过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.prototype.$serviceName = SERVICE_NAME
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
